package com.lyc.day1103.demo01;

/**
 * @author ：Xiaochen
 * @date ：Created in 2022/11/3 20:01
 * @description：
 * @modified By：
 * @version:
 */
public class Test {
    public static void main(String[] args) {

        MyRunnable myRunnable = new MyRunnable();
        Thread t1 = new Thread(myRunnable);
        t1.start();

        Runnable runnable=new Runnable() {
            @Override
            public void run() {
                System.out.println("----------这是匿名内部类");
            }
        };
        Thread t2 = new Thread(runnable);
        t2.start();

        //lambda表达式 没有关注方法的名称 以及方法的返回类型
        Runnable r=()->{
            System.out.println("这是lambda表达式");
        };
        Thread t3 = new Thread(r);
        t3.start();
    }
}

class MyRunnable implements Runnable{

    @Override
    public void run() {
        System.out.println("-----------这是自定义接口实现类");
    }
}